package com.lemon.cloud.comm.constants;

public class OAuth2Constant {
    /**
     * 协议字段
     */
    public static final String DETAILS_LICENSE = "license";

    /**
     * 用户信息
     */
    public static final String DETAILS_USER = "user_info";

    /**
     * 用户名
     */
    public static final String USERNAME = "username";

    /**
     * 项目的license
     */
    public static final String PROJECT_LICENSE = "https://lemon-cloud.com";

    /**
     * 客户端模式
     */
    public static final String CLIENT_CREDENTIALS = "client_credentials";

    /**
     * BEARER
     */
    public static final String BEARER = "bearer";

    /**
     * refresh_token
     */
    public static final String REFRESH_TOKEN = "refresh_token";

    /**
     * access_token
     */
    public static final String ACCESS_TOKEN = "access_token";

    /**
     * JSESSIONID
     */
    public static final String JSESSIONID = "JSESSIONID";

    public static final String BCRYPT = "{bcrypt}";

    public static final String USER_ONLINE_PREFIX = "user:online:";

    public static final String PRINCIPAL_KEY = "java.security.Principal";

    public static final String PRINCIPAL_NAME="principal";

    /**
     * 授权码模式confirm
     */
    public static final String CUSTOM_CONSENT_PAGE_URI = "/oauth2/confirm_access";

    /**
     * 授权码模式 login接口
     */
    public static final String CUSTOM_CONSENT_LOGIN_URL = "/oauth2/form";

    /**
     * 授权码模式 login页面
     */
    public static final String CUSTOM_CONSENT_LOGIN_PAGE = "/oauth2/login";

    /**
     * 登录接口，用于密码解密拦截
     */
    public static final String PASSWORD_LOGIN = "/oauth2/token";

    /**
     * check_token URI
     */
    public static final String CHECK_TOKEN_URI = "/oauth2/check_token";

    /**
     * 角色前缀
     */
    public static final String ROLE_PREFIX="ROLE_";

    /**
     * 请求头携带应用
     */
    public static final String APP_ID_HEAD="app-id";

    /**
     * 内部
     */
    public static final String FROM_IN = "lemon-cloud-feign-from";

    /**
     * 标志
     */
    public static final String FROM = "from";

    public static final String EQUAL = "=";

    /**
     * 验证码有效期
     */
    public static final long CODE_TIME = 60;

    public static final long ACCESS_TOKEN_VALIDITY_SECONDS = 60 * 60 * 12;

    public static final long REFRESH_TOKEN_VALIDITY_SECONDS = 60 * 60 * 12 * 2;


}
